mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Removed comments regarding RFC test vectors
This commit is contained in:
@@ -142,39 +142,4 @@ decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocato
|
|||||||
outi += 5;
|
outi += 5;
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @note(zh): Test inputs. Taken from RFC4648
|
|
||||||
/*
|
|
||||||
import "core:fmt"
|
|
||||||
main :: proc() {
|
|
||||||
Test :: struct {
|
|
||||||
plain: string,
|
|
||||||
encoded: string,
|
|
||||||
};
|
|
||||||
|
|
||||||
test_vectors := [?]Test {
|
|
||||||
Test{"", ""},
|
|
||||||
Test{"f", "MY======"},
|
|
||||||
Test{"fo", "MZXQ===="},
|
|
||||||
Test{"foo", "MZXW6==="},
|
|
||||||
Test{"foob", "MZXW6YQ="},
|
|
||||||
Test{"fooba", "MZXW6YTB"},
|
|
||||||
Test{"foobar", "MZXW6YTBOI======"},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Encode test
|
|
||||||
for v in test_vectors {
|
|
||||||
enc := encode(([]byte)(v.plain));
|
|
||||||
fmt.printf("encode(\"%s\") => \"%s\" \t| want: \"%s\"\n", v.plain, enc, v.encoded);
|
|
||||||
delete(enc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode test
|
|
||||||
for v in test_vectors {
|
|
||||||
dec := decode(v.encoded);
|
|
||||||
fmt.printf("decode(\"%s\") => \"%s\" \t| want: \"%s\"\n", v.encoded, string(dec), v.plain);
|
|
||||||
delete(dec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@@ -90,39 +90,4 @@ decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocato
|
|||||||
out[j + 2] = byte(b2);
|
out[j + 2] = byte(b2);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @note(zh): Test inputs. Taken from RFC4648
|
|
||||||
/*
|
|
||||||
import "core:fmt"
|
|
||||||
main :: proc() {
|
|
||||||
Test :: struct {
|
|
||||||
plain: string,
|
|
||||||
encoded: string,
|
|
||||||
};
|
|
||||||
|
|
||||||
test_vectors := [?]Test {
|
|
||||||
Test{"", ""},
|
|
||||||
Test{"f", "Zg=="},
|
|
||||||
Test{"fo", "Zm8="},
|
|
||||||
Test{"foo", "Zm9v"},
|
|
||||||
Test{"foob", "Zm9vYg=="},
|
|
||||||
Test{"fooba", "Zm9vYmE="},
|
|
||||||
Test{"foobar", "Zm9vYmFy"},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Encode test
|
|
||||||
for v in test_vectors {
|
|
||||||
enc := encode(([]byte)(v.plain));
|
|
||||||
fmt.printf("encode(\"%s\") => \"%s\" \t| want: \"%s\"\n", v.plain, enc, v.encoded);
|
|
||||||
delete(enc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode test
|
|
||||||
for v in test_vectors {
|
|
||||||
dec := decode(v.encoded);
|
|
||||||
fmt.printf("decode(\"%s\") => \"%s\" \t| want: \"%s\"\n", v.encoded, string(dec), v.plain);
|
|
||||||
delete(dec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
Reference in New Issue
Block a user