This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Documenting io/nonblock and how the methods (nonblock?, nonblock=, nonblock{}) there behave | |
# | |
# server.rb | |
require 'socket' | |
TCPServer.open('localhost', 3030) do |server| | |
while client = server.accept |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'active_support/all' | |
require 'digest/sha1' | |
def leftrotate(value, shift) | |
return ( ((value << shift) | (value >> (32 - shift))) & 0xffffffff) | |
end | |
# FIPS 180-2 -- relevant section #'s below |