spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Ruby SHA2 digest incorrect doc or issue in my IRB?


Seems like there is a typo in docs, look,

block_length → Integer
Returns the block length of the digest in bytes.

Digest::SHA256.new.digest_length * 8
# => 512
Digest::SHA384.new.digest_length * 8
# => 1024
Digest::SHA512.new.digest_length * 8
# => 1024

digest_length → Integer
Returns the length of the hash value of the digest
in bytes.

Digest::SHA256.new.digest_length * 8
# => 256
Digest::SHA384.new.digest_length * 8
# => 384
Digest::SHA512.new.digest_length * 8
# => 512

Both are using digest_length in examples.

But instead it should be,

block_length → Integer
Returns the block length of the digest in bytes.

Digest::SHA256.new.block_length * 8
# => 512
Digest::SHA384.new.block_length * 8
# => 1024
Digest::SHA512.new.block_length * 8
# => 1024

digest_length → Integer
Returns the length of the hash value of the digest
in bytes.

Digest::SHA256.new.digest_length * 8
# => 256
Digest::SHA384.new.digest_length * 8
# => 384
Digest::SHA512.new.digest_length * 8
# => 512

Categories : Ruby

Related to : Ruby SHA2 digest incorrect doc or issue in my IRB?
Digest Authentication not working in JMeter
Realm should not be required for digest authentication, domain is quite enough Make sure that you're using either HttpClient3.1 or HttpClient4 implementation See Windows Authentication with Apache JMeter guide for details on how to configure HTTP Authorization Manager for digest and kerberos authentication types

Categories : Http
How do I read the message: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations
I'm not sure I understand this completely, but here's what I found out on my own. After the colon there are two brackets. (...'atchers fired in the last 5 iterations: [[{"msg') The first bracket is the beginning of a json block. Copy from the first bracket to the end of the error and find a way to pretty-print that json. (Use your favorite code editor or an online json formatter) Now you have

Categories : Angularjs
AngularJs: Error: Custom filter for pairing items throw error: "10 $digest() iterations reached. Aborting!"
You CANNOT use the filter method to modify the data structure. Modifying the data creates an endless cycle, where each modification to the data causes the $digest to queue another $watch(), which in turn queues another call to the filter, which causes another data modification, ad nauseam. The error you are receiving is Angular's way of saying that this could go on forever, so it stops it from

Categories : Javascript
D3.js Sunburst Incorrect Arc Scales
Changing the partition call, to include a .sort(null) like this - var partition = d3.layout.partition() .sort(null) //<-- was missing this .value(function(d) { return 1; }); Seems to have resolved the strange arc scale problems.

Categories : Javascript
Incorrect math/rounding?
The issue is here, double P = Math.pow(z,(3 / 2)); More specifically here (3 / 2) because that is integer math. You could use (3 / (double) 2) or (1.5)

Categories : Java
Recently Add
Parsing through nested hash using .present? - undefined method `[]' for nil:NilClass (NoMethodError)
"params" doesn't work in Ruby (Sinatra framework)
Specifying a Puppet + Ruby version matrix in CircleCI
How to upload a file using RestClient in Ruby?
Shibboleth authentication in Rails
Random, intermittent "argument out of range" error while parsing CSV and parsing time
Ruby: Wrong number of Arguments for a subclass changes number of arguments
amalgamate two ruby arrays
Geocoder request.location returns nil
Access most recent table row and its data
how to search multiple word in the same file using ruby and the get the output which contains those words
MongoDB search query for stats
rake command parsing options after --
Ruby: cannot load such file - LoadError
Understanding attributes in AWS DynamoDB with Ruby
Ruby: Get last character from user input
Undefined method 'delegate' for capybara::dsl::module
neo4j ruby wrapper create or update
'on raise' hook in ruby
Ruby OCI8 - bind optional parameters to Oracle Stored procedure
How to install the app only once for the suite
Different test unit output in Rubymine and console
Can Rake run each test in a separate Ruby instance?
Ruby strftime in UK format i.e. dd/mm/yy
Accessing hash in Ruby like objects in Coffeescript
How do I correct my script, that it doesn't matter what file name has the .xml that is uploaded?
Ruby: Tests not runing
Do I have to install Ruby on my Apache server to run scripts
Ruby: Does Test::Unit still exist?
How do I make a form that changes color with input text in Ruby?
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.