Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add copy_buffer

  • Loading branch information...
commit a45f093e47be7abe6eb2391a4b301c7200448368 1 parent 868ef9a
@andrewschaaf andrewschaaf authored
Showing with 10 additions and 0 deletions.
  1. +7 −0 node-misc.coffee
  2. +3 −0  test/test-copy_buffer.coffee
View
7 node-misc.coffee
@@ -1,6 +1,12 @@
crypto = require 'crypto'
+copy_buffer = (buffer) ->
+ result = new Buffer buffer.length
+ buffer.copy result
+ result
+
+
sha1_hex_of = (data) ->
data = data.toString('utf8') if (typeof data) == 'string'
hash = crypto.createHash 'sha1'
@@ -9,5 +15,6 @@ sha1_hex_of = (data) ->
module.exports = {
+ copy_buffer
sha1_hex_of
}
View
3  test/test-copy_buffer.coffee
@@ -0,0 +1,3 @@
+describe "copy_buffer", () ->
+
+ xit()
Please sign in to comment.
Something went wrong with that request. Please try again.