Browse Source

Change variable len to n

master
Blink The Things 3 years ago
parent
commit
2daf39dc66
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      modhex.go

+ 6
- 6
modhex.go View File

@ -30,23 +30,23 @@ func EncodedLen(n int) int {
// EncodedLen(len(src)).
func Encode(dst, src []byte) int {
// keep track of the number of bytes written to dst
len := 0
n := 0
// convert each byte of src and store in dst
for _, v := range src {
// convert the upper nibble to modhex
// and store it into dst
dst[len] = modhexTable[v>>4]
len++
dst[n] = modhexTable[v>>4]
n++
// convert the lower nibble to modhex
// and store it into dst
dst[len] = modhexTable[v&0x0f]
len++
dst[n] = modhexTable[v&0x0f]
n++
}
// return the number of bytes written
return len
return n
}
// EncodeToString returns the modhex encoding of src as a string.


Loading…
Cancel
Save