Compare commits

..

No commits in common. "v0.1.0-develop.76" and "v0.1.0-develop.75" have entirely different histories.

4 changed files with 9 additions and 12 deletions

View File

@ -1,10 +1,3 @@
# [0.1.0-develop.76](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.75...v0.1.0-develop.76) (2023-11-18)
### Bug Fixes
* more base64urlpad fixes ([0f4b978](https://git.lumeweb.com/LumeWeb/libs5/commit/0f4b9789401075ac783edd9bd91e4e3f417e4329))
# [0.1.0-develop.75](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.74...v0.1.0-develop.75) (2023-11-18) # [0.1.0-develop.75](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.74...v0.1.0-develop.75) (2023-11-18)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.75",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.75",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.76", "version": "0.1.0-develop.75",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -19,7 +19,11 @@ export default abstract class Multibase {
} }
bytes = base32.decode(str); bytes = base32.decode(str);
} else if (data[0] === "u") { } else if (data[0] === "u") {
bytes = base64urlpad.decode(data); let str = data[0].toUpperCase() + data.substring(1);
while (str.length % 4 !== 0) {
str += "=";
}
bytes = base64urlpad.decode(str);
} else if (data[0] === ":") { } else if (data[0] === ":") {
bytes = utf8ToBytes(data); bytes = utf8ToBytes(data);
} else { } else {
@ -38,7 +42,7 @@ export default abstract class Multibase {
} }
toBase64Url(): string { toBase64Url(): string {
return `u${base64urlpad.encode(this.toBytes())}`; return `u${base64.encode(this.toBytes())}`;
} }
toBase58(): string { toBase58(): string {