Skip to content

Commit 9d8421c

Browse files
committed
refactor: standardize hexadecimal constants to lowercase
Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
1 parent 7b3bf4b commit 9d8421c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cameron.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func Identicon(data []byte, cell int) image.Image {
2828
var nib [32]byte
2929
for i := 0; i < 16; i++ {
3030
nib[2*i] = digest[i] >> 4 // High 4 bits.
31-
nib[2*i+1] = digest[i] & 0x0F // Low 4 bits.
31+
nib[2*i+1] = digest[i] & 0x0f // Low 4 bits.
3232
}
3333

3434
// Build the 5×5 symmetry mask.
@@ -66,8 +66,8 @@ func Identicon(data []byte, cell int) image.Image {
6666
v = (v << 4) | uint32(nib[i])
6767
}
6868
hueBits := v >> 16
69-
satBits := (v >> 8) & 0xFF
70-
lgtBits := v & 0xFF
69+
satBits := (v >> 8) & 0xff
70+
lgtBits := v & 0xff
7171
h := float64(hueBits) * 360 / 4095
7272
s := 65.0 - float64(satBits)*20/255
7373
l := 75.0 - float64(lgtBits)*20/255

0 commit comments

Comments
 (0)