You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stringEncoding.test.js 421 B

123456789101112131415
  1. const assert = require("assert");
  2. const {
  3. stringToArrayBuffer,
  4. arrayBufferToHex
  5. } = require("../src/stringEncoding");
  6. describe("stringEncoding", () => {
  7. it("stringToArrayBuffer", () => {
  8. assert.equal(stringToArrayBuffer("ȧ")[0], 200);
  9. assert.equal(stringToArrayBuffer("ȧ")[1], 167);
  10. });
  11. it("arrayBufferToHex", () => {
  12. assert.equal(arrayBufferToHex(new Uint8Array([200, 167])), "c8a7");
  13. });
  14. });