Compare commits
4 Commits
v0.2.0-dev
...
v0.2.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 1c17234025 | |
Derrick Hammer | 381abb7486 | |
Derrick Hammer | 42d52444c8 | |
Derrick Hammer | a813ee35f3 |
|
@ -1,3 +1,10 @@
|
|||
# [0.2.0-develop.17](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.16...v0.2.0-develop.17) (2023-06-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* re-export most of noble utility functions ([a813ee3](https://git.lumeweb.com/LumeWeb/libweb/commit/a813ee35f359a6f019d53b3bad0d9585dcc0d23e))
|
||||
|
||||
# [0.2.0-develop.16](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.15...v0.2.0-develop.16) (2023-06-26)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.16",
|
||||
"version": "0.2.0-develop.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.16",
|
||||
"version": "0.2.0-develop.17",
|
||||
"dependencies": {
|
||||
"@lumeweb/community-portals": "^0.1.0-develop.2",
|
||||
"@lumeweb/libportal": "^0.2.0-develop.10",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/libweb",
|
||||
"version": "0.2.0-develop.16",
|
||||
"version": "0.2.0-develop.17",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { addContextToErr } from "./err.js";
|
||||
import { Err } from "./types.js";
|
||||
import { bytesToHex } from "@noble/hashes/utils";
|
||||
|
||||
const MAX_UINT_64 = 18446744073709551615n;
|
||||
|
||||
|
@ -29,7 +30,7 @@ function b64ToBuf(b64: string): [Uint8Array, Err] {
|
|||
// bufToHex takes a Uint8Array as input and returns the hex encoding of those
|
||||
// bytes as a string.
|
||||
function bufToHex(buf: Uint8Array): string {
|
||||
return [...buf].map((x) => x.toString(16).padStart(2, "0")).join("");
|
||||
return bytesToHex(buf);
|
||||
}
|
||||
|
||||
// bufToB64 will convert a Uint8Array to a base64 string with URL encoding and
|
||||
|
@ -119,12 +120,4 @@ function hexToBuf(hex: string): [Uint8Array, Err] {
|
|||
return [u8, null];
|
||||
}
|
||||
|
||||
export {
|
||||
b64ToBuf,
|
||||
bufToHex,
|
||||
bufToB64,
|
||||
bufToStr,
|
||||
decodeU64,
|
||||
encodeU64,
|
||||
hexToBuf,
|
||||
};
|
||||
export { b64ToBuf, bufToB64, bufToStr, decodeU64, encodeU64, hexToBuf };
|
||||
|
|
23
src/index.ts
23
src/index.ts
|
@ -1,6 +1,29 @@
|
|||
import { ed25519 } from "@noble/curves/ed25519";
|
||||
import { sha512 } from "@noble/hashes/sha512";
|
||||
|
||||
export {
|
||||
bytesToHex,
|
||||
hexToBytes,
|
||||
toBytes,
|
||||
concatBytes,
|
||||
randomBytes,
|
||||
} from "@noble/hashes/utils";
|
||||
export {
|
||||
numberToHexUnpadded,
|
||||
hexToNumber,
|
||||
bytesToNumberBE,
|
||||
bytesToNumberLE,
|
||||
numberToBytesBE,
|
||||
numberToBytesLE,
|
||||
numberToVarBytesBE,
|
||||
ensureBytes,
|
||||
equalBytes,
|
||||
utf8ToBytes,
|
||||
bitLen,
|
||||
bitGet,
|
||||
bitSet,
|
||||
bitMask,
|
||||
} from "@noble/curves/abstract/utils";
|
||||
export * from "./err.js";
|
||||
export * from "./errTracker.js";
|
||||
export * from "./objAsString.js";
|
||||
|
|
Loading…
Reference in New Issue