Coder Social home page Coder Social logo

neilmayhew / hexdump-lazy Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 30 KB

Produce hex dumps lazily from various types of source

License: MIT License

Haskell 84.13% Nix 7.96% Makefile 1.95% Dockerfile 5.95%
haskell hex dump lazy lazy-evaluation hexdump

hexdump-lazy's Introduction

hexdump-lazy

A Haskell library that produces hex dumps lazily from various types of source.

The output is a list of lines with type [String]. Each line represents 16 bytes in the input.

Possible inputs include [Word8], ByteString and Ptr a.

The library itself has no dependencies beyond base and bytestring.

Example Output

$ cabal repl
λ> import qualified Data.ByteString as BS
λ> fp = "dist-newstyle/packagedb/ghc-8.10.2/package.cache"
λ> bs <- BS.readFile fp
λ> putStr . unlines . take 16 $ hexDumpByteString bs
0000:  00 67 68 63  70 6b 67 00  00 00 00 01  00 00 00 00  |.ghcpkg.........
0010:  00 00 00 00  00 00 04 95  00 00 00 00  00 00 00 01  |................
0020:  00 00 00 00  00 00 00 14  68 65 78 64  75 6d 70 2d  |........hexdump-
0030:  6c 61 7a 79  2d 30 2e 31  2e 30 2e 30  00 00 00 00  |lazy-0.1.0.0....
0040:  00 00 00 0c  68 65 78 64  75 6d 70 2d  6c 61 7a 79  |....hexdump-lazy
0050:  00 00 00 00  00 00 00 04  00 00 00 00  00 00 00 00  |................
0060:  00 00 00 00  00 00 00 01  00 00 00 00  00 00 00 00  |................
0070:  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  |................
0080:  00 00 00 00  00 00 00 00  1c 68 65 78  64 75 6d 70  |.........hexdump
0090:  2d 6c 61 7a  79 2d 30 2e  31 2e 30 2e  30 2d 69 6e  |-lazy-0.1.0.0-in
00a0:  70 6c 61 63  65 00 00 00  00 00 00 00  1c 68 65 78  |place........hex
00b0:  64 75 6d 70  2d 6c 61 7a  79 2d 30 2e  31 2e 30 2e  |dump-lazy-0.1.0.
00c0:  30 2d 69 6e  70 6c 61 63  65 00 00 00  00 00 00 00  |0-inplace.......
00d0:  00 00 00 00  00 00 00 00  07 69 6e 70  6c 61 63 65  |.........inplace
00e0:  00 00 00 00  00 00 00 02  00 00 00 00  00 00 00 0d  |................
00f0:  62 61 73 65  2d 34 2e 31  34 2e 31 2e  30 00 00 00  |base-4.14.1.0...

hexdump-lazy's People

Contributors

neilmayhew avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.