Skip to content

Instantly share code, notes, and snippets.

@WorksOnMyBox
WorksOnMyBox / read_rev_map.cs
Last active March 10, 2022 05:45
Read a git svn .rev_map file
FileStream fs = new FileStream(@".rev_map.a7f757b4-5dc9-1e4e-bcaa-e126dea94035", FileMode.Open);
BinaryReader br = new BinaryReader(fs);
while (br.BaseStream.Position < br.BaseStream.Length)
{
byte[] bRevision = br.ReadBytes(4);
Array.Reverse(bRevision);
int revision = BitConverter.ToInt32(bRevision, 0);
byte[] bHash = br.ReadBytes(20);
string hash = BitConverter.ToString(bHash).Replace("-", "").ToLower();

Keybase proof

I hereby claim:

  • I am worksonmybox on github.
  • I am worksonmybox (https://keybase.io/worksonmybox) on keybase.
  • I have a public key ASDmXY9-1JrvEGKFJZ-s7SF7nQhnLuBKNKA2XjQRdHSO-Ao

To claim this, I am signing this object: