GithubHelp home page GithubHelp logo

pachoo / russdeep Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emonti/russdeep

0.0 1.0 0.0 141 KB

Ruby bindings for libfuzzy (from ssdeep)

Home Page: http://github.com/emonti/russdeep

License: Other

Ruby 79.99% C 20.01%

russdeep's Introduction

russdeep

Ruby language bindings for the ssdeep ‘libfuzzy’ library api. This API lets you do fuzzy hash comparisons between files and arbitrary string buffers. Fuzzy hashes are also known as context triggered piecewise hashes (CTPH).

See the ssdeep homepage for more information:

http://ssdeep.sourceforge.net

Requirements

  • ssdeep’s libfuzzy - ssdeep.sourceforge.net The latest version of ssdeep known to work with russdeep is 2.5.

Installation

First ensure you have installed the ssdeep package and that libfuzzy is in your libpath. Then…

Gem

(sudo)? gem install russdeep

rake

git clone https://github.com/emonti/russdeep.git
cd russdeep
rake compile

Example

require "ssdeep"

data1 =<<__EOM__
Ruby language bindings for the ssdeep 'libfuzzy' library api. This API lets you do 
fuzzy hash comparisons between files and arbitrary string buffers. Fuzzy 
hashes are also known as context triggered piecewise hashes (CTPH).

See the ssdeep homepage for more information:
  http://ssdeep.sourceforge.net
__EOM__

hash1 = Ssdeep.from_string(data1)
hash2 = Ssdeep.from_string(data1 + "a little extra")
hash3 = Ssdeep.from_string(data1.gsub("ssdeep", "fuzzy"))
hash4 = Ssdeep.from_file("/etc/hosts")
hash5 = File.open("/etc/hosts"){|f| Ssdeep.from_fileno(f.fileno)}

Ssdeep.compare(hash1, hash1) # => 100
Ssdeep.compare(hash1, hash2) # => 97
Ssdeep.compare(hash1, hash3) # => 88
Ssdeep.compare(hash1, hash4) # => 0
Ssdeep.compare(hash4, hash5) # => 100

License

See LICENSE.txt

Copyright © 2011 Eric Monti. See LICENSE for details.

russdeep's People

Contributors

emonti avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.