GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 8eef3b63 authored by David Fifield's avatar David Fifield

Remove uniuri dependency.

https://bugs.torproject.org/33800
parent 237fed11
...@@ -2,13 +2,14 @@ package lib ...@@ -2,13 +2,14 @@ package lib
import ( import (
"bytes" "bytes"
"crypto/rand"
"encoding/hex"
"errors" "errors"
"io" "io"
"log" "log"
"sync" "sync"
"time" "time"
"github.com/dchest/uniuri"
"github.com/pion/webrtc/v2" "github.com/pion/webrtc/v2"
) )
...@@ -46,7 +47,13 @@ type WebRTCPeer struct { ...@@ -46,7 +47,13 @@ type WebRTCPeer struct {
func NewWebRTCPeer(config *webrtc.Configuration, func NewWebRTCPeer(config *webrtc.Configuration,
broker *BrokerChannel) *WebRTCPeer { broker *BrokerChannel) *WebRTCPeer {
connection := new(WebRTCPeer) connection := new(WebRTCPeer)
connection.id = "snowflake-" + uniuri.New() {
var buf [8]byte
if _, err := rand.Read(buf[:]); err != nil {
panic(err)
}
connection.id = "snowflake-" + hex.EncodeToString(buf[:])
}
connection.config = config connection.config = config
connection.broker = broker connection.broker = broker
connection.offerChannel = make(chan *webrtc.SessionDescription, 1) connection.offerChannel = make(chan *webrtc.SessionDescription, 1)
......
...@@ -4,7 +4,6 @@ go 1.13 ...@@ -4,7 +4,6 @@ go 1.13
require ( require (
git.torproject.org/pluggable-transports/goptlib.git v1.1.0 git.torproject.org/pluggable-transports/goptlib.git v1.1.0
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
github.com/golang/protobuf v1.3.1 // indirect github.com/golang/protobuf v1.3.1 // indirect
github.com/gorilla/websocket v1.4.1 github.com/gorilla/websocket v1.4.1
github.com/pion/sdp/v2 v2.3.4 github.com/pion/sdp/v2 v2.3.4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment