[Pkg-javascript-commits] [node-sha.js] 35/237: use bops for encoding/decoding

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:02:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-sha.js.

commit 48d1eb9eeee33c2bf55aaae4112ffdf236e20fa2
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Fri Dec 27 14:30:53 2013 +0700

    use bops for encoding/decoding
---
 util.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/util.js b/util.js
index 0c18fb7..03d6f94 100644
--- a/util.js
+++ b/util.js
@@ -3,8 +3,8 @@ exports.reverseByteOrder = reverseByteOrder
 exports.toHex = toHex
 exports.zeroFill = zeroFill
 exports.Uint32toHex = Uint32toHex
-
-
+exports.toString = toString
+var bopsToString = require('bops/typedarray/to')
 //change me: args should be:
 //buffer, string, enc, string_start, buffer_start
 //write will write as much of string into buffer as possible, and return the new length.
@@ -84,3 +84,8 @@ function Uint32toHex (n) {
   return s
 }
 
+
+function toString(buf, enc) {
+  if(null == enc) return buf
+  return bopsToString(buf, enc)
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-sha.js.git



More information about the Pkg-javascript-commits mailing list