sync: Peak a deterministic ID if 0
This commit is contained in:
parent
85ab183bed
commit
35d07c1aa4
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ package sync
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"hash/adler32"
|
||||||
"image"
|
"image"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -88,6 +89,11 @@ func parseExerciceDirname(edir string) (eid int, ename string, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ID 0: peak a deterministic-random-ordered ID instead
|
||||||
|
if eid == 0 {
|
||||||
|
eid = int(adler32.Checksum([]byte(edir_splt[1])))
|
||||||
|
}
|
||||||
|
|
||||||
ename = edir_splt[1]
|
ename = edir_splt[1]
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Reference in a new issue