Skip to content

Commit

Permalink
Merge pull request #414 from BaseAdresseNationale/antoineludeau/fix-h…
Browse files Browse the repository at this point in the history
…ash-generator-for-common-toponym-id-legacy

Fixed hash generation for common toponym id legacy
  • Loading branch information
antoineludeau authored May 16, 2024
2 parents 4e1ad51 + 2c53885 commit 2601c19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/consumers/format-to-legacy-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const formatCommonToponymDataForLegacy = (commonToponym, district, pseudo
legacyCommonToponymId = `${cog}_${pseudoCodeVoieGenerator.getCode(legacyLabelValue, codeAncienneCommune)}`.toLowerCase()
// If the pseudo code is already used, we generate a new one with a hash from the common toponym id
if (commonToponymLegacyIDSet.has(legacyCommonToponymId)) {
legacyCommonToponymId = `${cog}_${createHmac('sha256').update(id).digest('hex').slice(0, 5)}`
legacyCommonToponymId = `${cog}_${createHmac('sha256', 'ban').update(id).digest('hex').slice(0, 5)}`
}
}

Expand Down

0 comments on commit 2601c19

Please sign in to comment.