Files
Windshaft-cartodb/lib/cache/model/named_maps_entry.js
Daniel García Aubert 281a079a62 Simplify folder structure
2019-10-07 09:40:50 +02:00

21 lines
429 B
JavaScript

'use strict';
var crypto = require('crypto');
function NamedMaps(owner, name) {
this.namespace = 'n';
this.owner = owner;
this.name = name;
}
module.exports = NamedMaps;
NamedMaps.prototype.key = function() {
return this.namespace + ':' + shortHashKey(this.owner + ':' + this.name);
};
function shortHashKey(target) {
return crypto.createHash('sha256').update(target).digest('base64').substring(0,6);
}