github.com/haraldrudell/parl@v0.4.176/android-serial.go (about)

     1  /*
     2  © 2023–present Harald Rudell <harald.rudell@gmail.com> https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package parl
     7  
     8  // NewAndroidSerial returns Android serial for s
     9  //   - typically a string of a dozen or so 8-bit chanacters consisting of
    10  //     lower and upper case a-zA-Z0-9
    11  func NewAndroidSerial(s string) (serial AndroidSerial) { return AndroidSerial(s) }
    12  
    13  // IsValid() returns whether a contains a valid Android serial
    14  func (a AndroidSerial) IsValid() (isValid bool) { return len(string(a)) > 0 }
    15  
    16  func (a AndroidSerial) String() (s string) { return string(a) }