mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
d062ffc1ba
This commit fixes problems with source maps in Chrome Devtools by substituting source map URL generated by TS compiler with actual file URL pointing to DENO_DIR. Dummy value of "source_map_url" has been removed from "ScriptOrigin". Also fixes lock file which used compiled source code to generate lock hash; it now uses source code of the file that is being compiled.
15 lines
378 B
Rust
15 lines
378 B
Rust
use std::fmt::Write;
|
|
|
|
pub fn gen(v: Vec<&[u8]>) -> String {
|
|
let mut ctx = ring::digest::Context::new(&ring::digest::SHA256);
|
|
for src in v.iter() {
|
|
ctx.update(src);
|
|
}
|
|
let digest = ctx.finish();
|
|
let mut out = String::new();
|
|
// TODO There must be a better way to do this...
|
|
for byte in digest.as_ref() {
|
|
write!(&mut out, "{:02x}", byte).unwrap();
|
|
}
|
|
out
|
|
}
|