code: async function sign(oid, hash_algo, m, d, hashed) {
    const { secretKey } = nacl.sign.keyPair.fromSeed(d);
    const signature = nacl.sign.detached(hashed, secretKey);
    // EdDSA signature params are returned in little-endian format
    return {
      R: signature.subarray(0, 32),
      S: signature.subarray(32)
    };
  }
docs: Sign a message using the provided key
  @param  {module:type/oid}   oid       Elliptic curve object identifier
  @param  {module:enums.hash} hash_algo Hash algorithm used to sign
  @param  {Uint8Array}        m         Message to sign
  @param  {Uint8Array}        d         Private key used to sign
  @param  {Uint8Array}        hashed    The hashed message
  @returns {{R: Uint8Array,
  S: Uint8Array}}            Signature of the message
  @async