Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
d88a3faf
Commit
d88a3faf
authored
3 years ago
by
Jano Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
Added type to address hash (if it is not unknown)
parent
27623fdc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
address_utils/address_utils.go
+5
-1
5 additions, 1 deletion
address_utils/address_utils.go
with
5 additions
and
1 deletion
address_utils/address_utils.go
+
5
−
1
View file @
d88a3faf
...
...
@@ -9,12 +9,16 @@ import (
)
// MD5HashOfAddress m(E,L,L) - calculates and returns the MD5 hash of the entered address, lat and lng concatenated together. If lat and lng is blank, it is only the hash of the entered address
func
MD5HashOfAddress
(
enteredAddress
string
,
lat
*
float64
,
lng
*
float64
)
string
{
func
MD5HashOfAddress
(
enteredAddress
string
,
lat
*
float64
,
lng
*
float64
,
addressType
*
string
)
string
{
valueToHash
:=
enteredAddress
if
lat
!=
nil
&&
lng
!=
nil
{
valueToHash
+=
fmt
.
Sprintf
(
",%v,%v"
,
*
lat
,
*
lng
)
}
if
addressType
!=
nil
&&
len
(
*
addressType
)
>
0
&&
*
addressType
!=
"unknown"
{
valueToHash
+=
fmt
.
Sprintf
(
",%s"
,
*
addressType
)
}
return
fmt
.
Sprintf
(
"%X"
,
md5
.
Sum
([]
byte
(
valueToHash
)))
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment