How to use the ts-md5.Md5.hashStr function in ts-md5

To help you get started, we’ve selected a few ts-md5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github foli / ngFire-Course / src / app / shared / upload / upload.service.ts View on Github external
uploadTask(path, file, meta, uploadType) {
    const nameHash = Md5.hashStr(file.name + new Date().getTime());
    const fileExt = file.type.split('/')[1];
    const name = `${nameHash}.${fileExt}`;

    const newMeta = {
      ...meta,
      someMoreData: 'Moooore data'
    };

    const ref = this.storage.ref(`${path}/${name}`);
    const task = ref.put(file, { customMetadata: newMeta });

    // add the following lines
    task.snapshotChanges().pipe(
      finalize(() => {
        this.downloadURL = ref.getDownloadURL();
        console.log('Image Uploaded!');
github eclipse-theia / theia / packages / scm / src / browser / scm-avatar-service.ts View on Github external
async getAvatar(email: string): Promise {
        const hash = Md5.hashStr(email);
        return `https://www.gravatar.com/avatar/${hash}?d=robohash`;
    }
}
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / utils / id-generator.ts View on Github external
export function generateWMTSIdFromSourceOptions(options: WMTSDataSourceOptions) {
  const layer = options.layer;
  const chain = 'wmts' + options.url + layer;
  return Md5.hashStr(chain) as string;
}
github eclipse-theia / theia / packages / messages / src / browser / notifications-manager.ts View on Github external
protected getMessageId(m: PlainMessage): string {
        return String(Md5.hashStr(`[${m.type}] ${m.text} : ${(m.actions || []).join(' | ')};`));
    }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / utils / id-generator.ts View on Github external
export function generateWMSIdFromSourceOptions(options: WMSDataSourceOptions) {
  const layers = options.params.LAYERS;
  const url = options.url.charAt(0) === '/' ? window.location.origin + options.url : options.url;
  const chain = 'wms' + url + layers;
  return Md5.hashStr(chain) as string;
}
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / datasource / shared / datasources / feature-datasource.ts View on Github external
protected generateId() {
    if (!this.options.url) {
      return uuid();
    }
    const chain = 'feature' + this.options.url;
    return Md5.hashStr(chain) as string;
  }
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / datasource / shared / datasources / mvt-datasource.ts View on Github external
protected generateId() {
    if (!this.options.url) {
        return uuid();
    }
    const chain = 'mvt' + this.options.url;
    return Md5.hashStr(chain) as string;
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / datasource / utils / id-generator.ts View on Github external
export function generateFeatureIdFromSourceOptions(options: WMTSDataSourceOptions) {
  if (! options.url) { return generateId(options); }
  const chain = 'feature' + options.url;
  return Md5.hashStr(chain) as string;
}
github rabix / benten / vscode-client / src / extension.ts View on Github external
function updateWebviewContent(panel: WebviewPanel, on_disk_files: [string, Uri]) {

	const activeEditor = window.activeTextEditor;
	if (!activeEditor) {
		return;
	}
	const graph_name = Md5.hashStr(activeEditor.document.uri.toString()) + ".json"

	const data_uri = path.join(preview_scratch_directory, graph_name);
	var graph_data = JSON.parse(fs.readFileSync(data_uri, "utf8"));

	panel.webview.html = `


    
		
		<title>Benten: ${activeEditor.document.uri.toString()}</title>
		
		
		

		<style type="text/css">
</style>
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / datasource / shared / datasources / wmts-datasource.ts View on Github external
protected generateId() {
    const layer = this.options.layer;
    const chain = 'wmts' + this.options.url + layer;

    return Md5.hashStr(chain) as string;
  }

ts-md5

TypeScript MD5 implementation

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis