Compare commits

..

No commits in common. "master" and "v0.2.0" have entirely different histories.

3 changed files with 5 additions and 53 deletions

View File

@ -1,15 +1,7 @@
import { import {
decodeAscii85,
decodeBase32,
decodeBase58,
decodeBase64, decodeBase64,
decodeBase64Url,
decodeHex, decodeHex,
encodeAscii85,
encodeBase32,
encodeBase58,
encodeBase64, encodeBase64,
encodeBase64Url,
encodeHex, encodeHex,
} from "jsr:@std/encoding@^1.0.6"; } from "jsr:@std/encoding@^1.0.6";
@ -43,22 +35,6 @@ export function to_hex(b: BinaryLike): string {
return encodeHex(to_utf8(b)); return encodeHex(to_utf8(b));
} }
export function from_base32(s: BinaryLike): Uint8Array {
return decodeBase32(from_utf8(s));
}
export function to_base32(b: BinaryLike): string {
return encodeBase32(to_utf8(b));
}
export function from_base58(s: BinaryLike): Uint8Array {
return decodeBase58(from_utf8(s));
}
export function to_base58(b: BinaryLike): string {
return encodeBase58(to_utf8(b));
}
export function from_base64(s: BinaryLike): Uint8Array { export function from_base64(s: BinaryLike): Uint8Array {
return decodeBase64(from_utf8(s)); return decodeBase64(from_utf8(s));
} }
@ -67,22 +43,6 @@ export function to_base64(b: BinaryLike): string {
return encodeBase64(to_utf8(b)); return encodeBase64(to_utf8(b));
} }
export function from_base64url(s: BinaryLike): Uint8Array {
return decodeBase64Url(from_utf8(s));
}
export function to_base64url(b: BinaryLike): string {
return encodeBase64Url(to_utf8(b));
}
export function from_ascii85(s: BinaryLike): Uint8Array {
return decodeAscii85(from_utf8(s));
}
export function to_ascii85(b: BinaryLike): string {
return encodeAscii85(to_utf8(b));
}
export function read_u8(b: Uint8Array, i = 0) { export function read_u8(b: Uint8Array, i = 0) {
return b[i]; return b[i];
} }

View File

@ -1,5 +1,5 @@
{ {
"name": "@luaneko/lstd", "name": "@luaneko/lstd",
"version": "0.2.1", "version": "0.2.0",
"exports": "./mod.ts" "exports": "./mod.ts"
} }

16
mod.ts
View File

@ -1,20 +1,12 @@
export { export {
type BinaryLike, type BinaryLike,
from_utf8, from_utf8,
from_hex,
from_base32,
from_base58,
from_base64,
from_base64url,
from_ascii85,
to_utf8, to_utf8,
to_hex,
to_base32,
to_base58,
to_base64,
to_base64url,
to_ascii85,
encode_utf8, encode_utf8,
from_hex,
to_hex,
from_base64,
to_base64,
read_u8, read_u8,
write_u8, write_u8,
read_i8, read_i8,