openwallet-foundation-labs / sd-jwt-js

A JavaScript implementation of the Selective Disclosure JWT (SD-JWT) spec.
https://sdjwt.js.org/
Apache License 2.0
36 stars 12 forks source link

Change the util/base64 function names to start with lowercase #178

Closed aceshim closed 6 months ago

aceshim commented 6 months ago

By following the common javascript convention, I suggest all function names to be camelCase (or at least start with lowercase). Especially when remarks can be misunderstood as a type instead of a function when imported somewhere else.

current

import { Base64 } from 'js-base64';

export const Base64urlEncode = Base64.encodeURI;

export const Base64urlDecode = Base64.decode;

export const Uint8ArrayToBase64Url = (input: Uint8Array): string =>
  Base64.fromUint8Array(input, true);

to-be

import { Base64 } from 'js-base64';

export const base64UrlEncode = Base64.encodeURI;

export const base64UrlDecode = Base64.decode;

export const uint8ArrayToBase64Url = (input: Uint8Array): string =>
  Base64.fromUint8Array(input, true);
lukasjhan commented 6 months ago

Yeah. It's reasonable. I'll fix it right away :)