Sha256: a187a537f82e20c25aab296ad72f8fb04b17e586cb49befb3d2b33df2fdc84ba
Contents?: true
Size: 783 Bytes
Versions: 3
Compression:
Stored size: 783 Bytes
Contents
# encoding: UTF-8 require File.dirname(__FILE__) + '/spec_helper' describe "the SJCL hex codec" do it "should encode from hex" do dec = SJCL::Codec::Hex.toBits("03dd1625d7f4d49c252b99316a720a1ff7e6b96f8e5c5893ac7a34fbf0872f26") expected = [64820773, -671820644, 623614257, 1785858591, -135874193, -1906550637, -1401277189, -259576026] SJCL::BitArray.compare(dec, expected).should eql(true) end it "should decode from bit array" do enc = SJCL::Codec::Hex.fromBits([64820773, -671820644, 623614257, 1785858591, -135874193, -1906550637, -1401277189, -259576026]) enc.should eql("03dd1625d7f4d49c252b99316a720a1ff7e6b96f8e5c5893ac7a34fbf0872f26") enc = SJCL::Codec::Hex.fromBits([1634952294, 26389914019328]) enc.should eql("61736466617366") end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sjcl-1.0.1 | spec/codex_hex_spec.rb |
sjcl-1.0.0 | spec/codex_hex_spec.rb |
sjcl-0.0.1 | spec/codex_hex_spec.rb |