Skip to content

Commit

Permalink
fix: IMEI/IMEISV validation, comment and function name
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlin0518 committed Jan 13, 2025
1 parent 361a2aa commit d66e015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nasConvert/MobileIdentity5GS.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func PeiToStringWithError(buf []byte) (string, error) {
return prefix + digitStr, nil
}

func ValidateIMEI(imei string) (bool, error) {
func validateIMEI(imei string) (bool, error) {
// Remove any non-digit characters
cleanIMEI := strings.ReplaceAll(imei, "-", "")
cleanIMEI = strings.ReplaceAll(cleanIMEI, " ", "")
Expand Down
2 changes: 1 addition & 1 deletion nasConvert/MobileIdentity5GS_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func TestPeiToStringWithError(t *testing.T) {
{
name: "Complete-Ivalid-IMEI",
args: args{
// Example encoding for a valid 15-digit IMEI
// Not valid 15-digit IMEI: CD(Check Digit) not valid
buf: []byte{
0x4b, 0x09, 0x51, 0x24, 0x30, 0x32, 0x57, 0x82,
},
Expand Down

0 comments on commit d66e015

Please sign in to comment.