RIP base64url (no pad)
Do not stand at my grave and weep
I am not there. I do not sleep.
I am a thousand winds that blow.
I am the diamond glints on snow.
I am the sunlight on ripened grain.
I am the gentle autumn rain.
When you awaken in the morningβs hush
I am the swift uplifting rush
Of quiet birds in circled flight.
I am the soft stars that shine at night.
Do not stand at my grave and cry;
I am not there. I did not die.
npm i @or13/demojid --save
const demojid = require("@or13/demojid");
const encoded = demojid.encode(
"did:key:z6MkpBcRnDUxz34RyvGFeBV6okX8VHABansfJ8Ya8wohRouy",
{
contentType: "application/did+json",
}
);
// "did:key:π
π¦¬π°ππ¦€π²πͺ°ππ¦’π΄ππ¦π
π¦§π¦ππππΏπΎπͺ±π²ππ¦¬π¦πππͺπππ±π²π¦π¦’π¦π¬π·πͺπ¦π¦πͺπ’π¦π ππ¦πΈπ"
const message =
"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa3RpU3pxRjlrcXdkVThWa2RCS3g1NkVZelhmcGduTlBVQUd6bnBpY05pV2ZuI3o2TWt0aVN6cUY5a3F3ZFU4VmtkQkt4NTZFWXpYZnBnbk5QVUFHem5waWNOaVdmbiJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0aVN6cUY5a3F3ZFU4VmtkQkt4NTZFWXpYZnBnbk5QVUFHem5waWNOaVdmbiIsInN1YiI6ImRpZDpleGFtcGxlOjEyMyIsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIiwiaHR0cHM6Ly93M2lkLm9yZy92Yy1yZXZvY2F0aW9uLWxpc3QtMjAyMC92MSIsImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIl0sImlkIjoidXJuOnV1aWQ6NDM0MzgxNzYtNDlkZi00M2I0LWE0ODMtMzQ3Mjk1NjQ3YTM5IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJpc3N1ZXIiOiJkaWQ6a2V5Ono2TWt0aVN6cUY5a3F3ZFU4VmtkQkt4NTZFWXpYZnBnbk5QVUFHem5waWNOaVdmbiIsImlzc3VhbmNlRGF0ZSI6IjIwMTAtMDEtMDFUMTk6MjM6MjRaIiwiY3JlZGVudGlhbFN0YXR1cyI6eyJpZCI6Imh0dHBzOi8vYXBpLmRpZC5hY3Rvci9yZXZvY2F0aW9uLWxpc3RzLzEuanNvbiMwIiwidHlwZSI6IlJldm9jYXRpb25MaXN0MjAyMFN0YXR1cyIsInJldm9jYXRpb25MaXN0SW5kZXgiOjAsInJldm9jYXRpb25MaXN0Q3JlZGVudGlhbCI6Imh0dHBzOi8vYXBpLmRpZC5hY3Rvci9yZXZvY2F0aW9uLWxpc3RzLzEuanNvbiJ9LCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpleGFtcGxlOjEyMyJ9fSwianRpIjoidXJuOnV1aWQ6NDM0MzgxNzYtNDlkZi00M2I0LWE0ODMtMzQ3Mjk1NjQ3YTM5IiwibmJmIjoxMjYyMzczODA0fQ.jkWiBFUGAnHe95dO_cybV81MoJYHKMA2i27uu-HlkddbSV1y3Jj7H0kdPqAJT2GIh6B4ea_X6fNu_gGw4tdoDQ";
const options = {
contentType: "application/jwt",
};
const encoded = demojid.encode(message, options);
// "πͺ±ππ·π π¦πΏπͺ°π‘π¦π‘π·πΎπͺ³π΅πππ¦π¦π»π¦π»π¦π¦π¦€πͺ³π³π»π¦¬π»π¦ππ¦€πͺ³π΄π¦€π¦©πͺ³πππ¦¬πͺ±π¦πͺ³π¦π¦π¦§ππ¦€ππ¦§π¦€π¦ππ¦π¦
π¦©πͺ°ππππππ πͺ²π¦π¦ππ³π¦π¦§πππ¦πππͺ³πͺ±π¦
π π¦πͺ°πΏππΈππ¦
π²ππ¦πππ¦¬π¦π¦’π²π¦€π¦ππ¦π¦€ππ¦πͺ³πΈπ»π¦§π¦π¦ππͺ²π¦ππ¦ππ¦π¦¬πͺ°ππ¦π¦π¦π¦§πΎπ¦§πͺ³πΎππ¦ππ¦π¦ππ¦ππ¦π¦π¦ππͺ³πΎπͺ²ππ¦€π¦πͺ³π¦’π²π¦’π¦ππ¦π¦πππΎππͺ±π¦π¦π’π¦πͺ²π¦π¦π¦πππ¦π¦π‘π·π¦.πͺ±ππ·π¦€πͺ°π¦§π°π‘π¦π‘π·ππ¦πͺ²π¦π¦¬π¦π¦ππ¦π¦π¦’π¦π¦ππͺ²π¦ππ¦ππ¦π¦¬πͺ°ππ¦π¦π¦π¦§πΎπ¦§πͺ³πΎππ¦ππ¦π¦ππ¦ππ¦π¦π¦ππͺ³πΎπͺ²ππ¦€π¦πͺ³π¦’π²π¦’π¦ππ¦π¦πππΎππͺ±π¦π¦π’π¦πͺ²π¦π¦π¦πππ¦π¦π‘π»π¦π»π¦’π¦ππ¦π‘π»π¦¬π»π¦ππ¦€πͺ³π΄π¦€π¦
πͺ±πΏπΎπ¦πͺ°πΏπ¦π¦
π¦π¦π΅ππ°ππ»π¦π»π¦’πͺ³π¦π»π¦π¦€ππ»ππ²π¦π¦π¦π¦ππͺ³ππ ππ»π¦π¦€π¦π»π¦π ππππ²π
π¦π‘πͺπππ¦§ππ¦§ππ¦’πͺ°π
ππ¦π¦ππͺ³ππͺππ°π΄π΅π¦ππ¦π¦ππͺ³πͺ²ππ¦
π¦π¦’ππ¦€π¦πͺ²π¦π
ππ¦§π¦π¦π»π‘π’π‘π¦ππππͺ°ππ°π¦¬πππ¦π¦§π°π¦π¦
πππ¦π¦ππͺ³ππ¦π¦π¦ππππͺ³ππͺ³ππ¦π¦πΎππ¦πͺ²π¦πΈππͺ²π¦π¦€πͺ°π¦§π¦π¦π°π¦π±ππ°π³π¦π¦π°π¦π»π¦π»π¦π ππππ²π
π¦π‘πͺπππ¦§ππ¦§ππ¦’πͺ°π
ππ¦π¦ππͺ³ππͺππ°π΄π΅π¦ππ¦π¦ππͺ³πͺ²ππ¦
π¦π¦’ππ¦€π¦πͺ²π¦π
ππ¦§π¦π¦π»π¦
ππ¦π»π¦π¦
ππ»π¦π¦π‘πππ·πΈπ¦π¦’πππ¦πͺ²π¦π¦¬π¦π΄π°ππ°π
ππ¦π¦π
π¦π¦π¦π΄π¦
ππͺ³π‘πππ°π¦π»πππͺ²π΅ππ¦π΄π°π¦π°π
π¦π¦§π°π¦πππ¦π¦π¦π¦§π¦ππ°π¦π»π‘π’π‘πππ¦
π’πͺ³π¦π»π¦¬πͺ²ππ·πͺ²πͺ³ππ·π¦€πͺ³π¦π¦
π π¦π¦π¦π¦
π¦π¦§π·π¦
πͺ³πΏππΈππΏπ¦
π π¦π³π·πππ³π·π¦€πͺ°π¦§π¦ππͺ³ππ»π‘π¦π‘π·ππ¦πͺ²π¦π¦¬π¦π¦ππ¦π¦π¦’π¦π¦ππͺ²π¦ππ¦ππ¦π¦¬πͺ°ππ¦π¦π¦π¦§πΎπ¦§πͺ³πΎππ¦ππ¦π¦ππ¦ππ¦π¦π¦ππͺ³πΎπͺ²ππ¦€π¦πͺ³π¦’π²π¦’π¦ππ¦π¦πππΎππͺ±π¦π¦π’π¦πͺ²π¦π¦π¦πππ¦π¦π‘π»π¦π»π¦π¦
π
πͺ°π¦§ππ π¦π¦π¦π¦
ππΏπΎππͺ³π¦π»π¦¬π»π¦π»π’π°ππ±π¦π°π΄π΅π¦π°π΄πΎππ°πππ¦¬π°π¦π°π¦¬π°π¦ππ¦π»π‘π’π‘π¦π¦§π·π¦
πͺ³πΏππΈππΏπ¦
π π¦πΎπ¦ππ¦ππππͺ°ππ»π¦¬πͺ±ππ·π¦€πͺ³π³π»π¦¬π»π¦π ππππ²π
π¦π‘πͺππ¦ππ²π¦€ππ¦ππ¦€πͺ³π³π¦π π¦π¦§πππͺ°π‘π¦ππͺ³ππͺ³ππ¦π¦πΎππ¦πͺ²π¦πΈππͺ²π¦π¦€πͺ°π¦§ππ
ππ
π΅πΈπ¦π¦’π¦ππ¦π‘π°π’π»π‘π’π‘πππ¦
π’πͺ³π¦π»π¦¬π»π¦
π·π¦
ππ¦π¦π¦π¦πππ¦€π¦π¦π¦π°π¦ππ¦ππ°π¦π±ππ°πΎπ¦ππ¦ππππͺ°ππ»π¦π»π¦’π·π¦
ππ¦π¦π¦π¦πππ¦€π¦π¦π¦π°π¦ππ¦ππ¦πͺ²π¦ππͺ³πππ‘π¦π¦π±π¦π»π¦’π·π¦
ππ¦π¦π¦π¦πππ¦€π¦π¦π¦π°π¦ππ¦ππ¦π¦§π·π¦
πͺ³πΏππΈππΏπ¦
π π¦π³π»π¦¬π»π¦π ππππ²π
π¦π‘πͺππ¦ππ²π¦€ππ¦ππ¦€πͺ³π³π¦π π¦π¦§πππͺ°π‘π¦ππͺ³ππͺ³ππ¦π¦πΎππ¦πͺ²π¦πΈππͺ²π¦π¦€πͺ°π¦§ππ
ππ
π΅πΈπ¦π¦’π¦ππ¦π‘π·π¦ππ³π·π¦πͺ°π¦πππͺ³πͺ²π¦ππ¦πͺ²πΎπ¦ππ¦§ππ‘π¦π¦ππ¦ππ³π»π¦¬πͺ±ππ·π¦€πͺ³π³π»π¦¬π»π¦ππ¦€πͺ³π΄π¦€π¦
πͺ±πΏπΎπ¦πͺ°πΏπ¦π¦
π¦π¦π΅ππ°ππ·π¦π¬π¦π’π‘π¦π¦’ππ¦€π»π¦π¦π‘πππ·πΈπ¦π¦’πππ¦πͺ²π¦π¦¬π¦π΄π°ππ°π
ππ¦π¦π
π¦π¦π¦π΄π¦
ππͺ³π‘πππ°π¦π»πππͺ²π΅ππ¦π΄π°π¦π°π
π¦π¦§π°π¦πππ¦π¦π¦π¦§π¦ππ°π¦π»π‘π’π‘π¦π¦π·π¦π»π¦π¦π¦π°π¦π¦ππ°π
πͺ°π
π¦π΄π±ππ¬π¦.π¦ππͺ²π‘π²πΎππΏπ±π¦’ππͺ±π¦π¦ππ¦ππͺ°ππ¦ππͺππ°π¦π·π¦πππ°π±π¦π‘π¦ππΈπΈπ¦ππ¦
ππππ¦π¦ππππ¦§π·π¦ππππππ¦πͺΆπ±π·ππ¦πΏπ»π π¦¬π²π¦πͺ±π¦πππ¦¬π¬π¦πΈπππΏπ’π¦π¦ππ¦π΄π¦"
const message = "hello world";
const encoded = demojid.encode(message);
// expect(encoded).toBe("π¦πΏππ¦π¦πΏπͺπππ¦π¦ππ¦πΏπ¦");
const decoded = demojid.decode(encoded);
// expect(decoded).toBe(message);