Compare commits

..

3 Commits

Author SHA1 Message Date
semantic-release-bot afaa6995dc chore(release): 0.1.0-develop.76 [skip ci]
# [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](0f4b978940))
2023-11-18 13:15:43 +00:00
Derrick Hammer f14050a83d
Merge remote-tracking branch 'origin/develop' into develop 2023-11-18 08:14:51 -05:00
Derrick Hammer 0f4b978940
fix: more base64urlpad fixes 2023-11-18 08:14:47 -05:00
4 changed files with 12 additions and 9 deletions

View File

@ -1,3 +1,10 @@
# [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)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

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