mirror of
https://github.com/cmur2/miflorad.git
synced 2024-11-14 18:56:14 +01:00
15 lines
364 B
Go
15 lines
364 B
Go
|
package common
|
||
|
|
||
|
import (
|
||
|
"regexp"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
const peripheralAddressAllowedChars = "[^a-z0-9]+"
|
||
|
|
||
|
var peripheralAddressAllowedCharsPattern = regexp.MustCompile(peripheralAddressAllowedChars)
|
||
|
|
||
|
func MifloraGetAlphaNumericID(peripheralAddress string) string {
|
||
|
return peripheralAddressAllowedCharsPattern.ReplaceAllString(strings.ToLower(peripheralAddress), "")
|
||
|
}
|