wickdninja's notebooks

  • Sha1 hash a string - /wickdninja/sha1-hash-a-string
    Last edited 6 years ago
    var crypto = require('crypto'); var twilio = 'this-is-always-the-same'; var target = 'this-comes-from-the-message-either-to-or-from-whichever-isnt-the-twilio-number'; var data = new Buffer.from(`${twilio}${target}`); var hash = crypto.createHash('sha1'); hash.update(data); var result = hash.digest('hex'); console.log(result.length); console.log(result);
  • Endpoint test - /wickdninja/endpoint-test
    Last edited 6 years ago
    exports.endpoint = function(request, response) { response.end("Hello world!"); }