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

all: replace []byte with []u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 15:35:35 +03:00
parent 0527ac633e
commit fb192d949b
164 changed files with 533 additions and 533 deletions

View File

@@ -37,7 +37,7 @@ fn (mut c Crc32) generate_table(poly int) {
}
}
fn (c &Crc32) sum32(b []byte) u32 {
fn (c &Crc32) sum32(b []u8) u32 {
mut crc := ~u32(0)
for i in 0 .. b.len {
crc = c.table[u8(crc) ^ b[i]] ^ (crc >> 8)
@@ -45,7 +45,7 @@ fn (c &Crc32) sum32(b []byte) u32 {
return ~crc
}
pub fn (c &Crc32) checksum(b []byte) u32 {
pub fn (c &Crc32) checksum(b []u8) u32 {
return c.sum32(b)
}
@@ -57,7 +57,7 @@ pub fn new(poly int) &Crc32 {
}
// calculate crc32 using ieee
pub fn sum(b []byte) u32 {
pub fn sum(b []u8) u32 {
c := new(int(crc32.ieee))
return c.sum32(b)
}