Skip to content

Commit

Permalink
Use np.random.bytes instead of os.urandom to generate message id
Browse files Browse the repository at this point in the history
  • Loading branch information
hekaisheng committed Aug 11, 2021
1 parent 7539043 commit 83c5233
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mars/oscar/backends/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache
from types import TracebackType
from typing import Any, Type, Tuple, Dict, List

import numpy as np

from ...lib.tblib import pickling_support
from ...serialization.core import Serializer, pickle, buffered
from ...utils import classproperty, dataslots, implements
Expand Down Expand Up @@ -358,4 +359,4 @@ def _get_slots(message_cls: Type[_MessageBase]):


def new_message_id():
return os.urandom(32)
return np.random.bytes(32)

0 comments on commit 83c5233

Please sign in to comment.