1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

lower/snake case consts & enums

This commit is contained in:
joe-conigliaro
2019-10-24 22:48:20 +11:00
committed by Alexander Medvednikov
parent fe17dd9a7e
commit 580abe0de4
20 changed files with 301 additions and 308 deletions

View File

@@ -8,14 +8,14 @@ module crc32
// polynomials
const (
IEEE = 0xedb88320
Castagnoli = 0x82f63b78
Koopman = 0xeb31d82e
ieee = 0xedb88320
castagnoli = 0x82f63b78
koopman = 0xeb31d82e
)
// The size of a CRC-32 checksum in bytes.
const (
Size = 4
size = 4
)
struct Crc32 {
@@ -56,8 +56,8 @@ pub fn new(poly int) &Crc32 {
return c
}
// calculate crc32 using IEEE
// calculate crc32 using ieee
pub fn sum(b []byte) u32 {
mut c := new(IEEE)
mut c := new(ieee)
return c.sum32(b)
}

View File

@@ -7,7 +7,7 @@ fn test_hash_crc32() {
assert sum1.hex() == '0x483f8cf0'
c := crc32.new(crc32.IEEE)
c := crc32.new(crc32.ieee)
b2 := 'testing crc32 again'.bytes()
sum2 := c.checksum(b2)
assert sum2 == u32(1420327025)