Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
/ ruby-marshal Public archive
forked from dozen/ruby-marshal

Ruby Marshal in Golang. (we've gone back to upstream)

Notifications You must be signed in to change notification settings

geckoboard/ruby-marshal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby-marshal

Parse Ruby Marshal Binary Data.

go get github.com/dozen/ruby-marshal

Example

irb(main):001:0> Marshal.dump({ user: { name: "matsumoto-yasunori", age: 57 }, job: "voice-actor" }).unpack("H*")
=> ["04087b073a09757365727b073a096e616d654922176d617473756d6f746f2d796173756e6f7269063a0645543a08616765693e3a086a6f62492210766f6963652d6163746f72063b0754"]
b, _ := hex.DecodeString("04087b073a..(omit)..f72063b0754")
var v Profile
NewDecoder(bytes.NewReader(b)).Decode(&v)
#=> Profile{User:User{ Name:"matsumoto-yasunori", Age:57 }, Job:"voice-actor" }

Usage

Follow marshal_test.go.

Reference

About

Ruby Marshal in Golang. (we've gone back to upstream)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%