Skip to content

Commit

Permalink
Truncate symbol hashes to 64 bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Dec 31, 2013
1 parent 8ec03b3 commit 4e75265
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use std::run;
use std::str;
use std::io;
use std::io::fs;
use extra::hex::ToHex;
use extra::tempfile::TempDir;
use syntax::abi;
use syntax::ast;
Expand Down Expand Up @@ -494,8 +495,10 @@ pub fn build_link_meta(sess: Session,
}
}

pub fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
symbol_hasher.result_str()
fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
let output = symbol_hasher.result_bytes();
// 64 bits should be enough to avoid collisions.
output.slice_to(8).to_hex()
}


Expand Down

5 comments on commit 4e75265

@bors
Copy link
Contributor

@bors bors commented on 4e75265 Jan 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at eddyb@4e75265

@bors
Copy link
Contributor

@bors bors commented on 4e75265 Jan 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging eddyb/rust/symbol-cleanup = 4e75265 into auto

@bors
Copy link
Contributor

@bors bors commented on 4e75265 Jan 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eddyb/rust/symbol-cleanup = 4e75265 merged ok, testing candidate = 736f5a8

@bors
Copy link
Contributor

@bors bors commented on 4e75265 Jan 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 4e75265 Jan 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 736f5a8

Please sign in to comment.